<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Relations\UserInfoTrait;

class CompanyComment extends Model
{
    use UserInfoTrait;
    
    protected $table = 'company_comment';

    protected $primaryKey = 'comment_id';

    protected $fillable = ['comment_id','company_id','job_id','content','user_id',
                          'to_comment_id', 'to_user_id'];

    function getCompanyName()
    {
//        return $this->belongsTo('App\Models\s');
    }

    public function jobs()
    {
        return $this->belongsTo('App\Models\CompanyJobs', 'job_id');
    }

    public function company()
    {
        return $this->belongsTo('App\Models\Company', 'company_id');
    }

    public function childComments()
    {
        return $this->hasMany('App\Models\CompanyComment','to_comment_id','comment_id');
    }
}
